<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
/* 
    对块级元素浮动
    1.外边距盒子塌陷：消失
    2.可以在同一行显示 
    
    行内元素有没有padding  左右有   上下看上去有，其实不起作用
    对行内元素浮动：      左右有     上下有

    对行内元素浮动
    1.可以设置宽高
    2.上下padding起作用
    */


    .main {
      width: 750px;
      height: 600px;
      border: 1px solid #000;
    }

    .item {
      width: 600px;
      height: 100px;
      background-color: yellowgreen;
      border: 1px solid #000;
      margin: 10px 0 10px;
      padding: 30px;


      /* float: left; */
      /* display: inline-block; */
    }
  </style>
</head>

<body>

  <div class="main">

    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>

    <!-- <span class="item">1</span>
    <span class="item">1</span>
    <span class="item">1</span>
    <span class="item">1</span> -->


  </div>

</body>

</html>